<template>
  <view class="item">
    <view class="u-flex flex_bt item-top">
      <view>
        <view class="u-flex img">
          <item-image :type="'1'" :img="item.userimg" :size="60"></item-image>
          <text class="u-margin-left-20">{{item.nickname}}</text>
        </view>
        <view class="u-flex">
          <view class="tag" v-for="data in item.type_name" :key="data">{{data}}</view>
        </view>
      </view>
      <view class="right">
        <view class="adress">{{item.storename}}</view>
        <view class="time">{{item.createdate}}</view>
      </view>
    </view>
    <view class="item-con" :class="{'two':show}">
      {{item.content}}
    </view>
    <view class="item-img  u-flex u-flex-wrap" >
      <view v-for="(data,index) in item.image" :key="index">
        <item-image :img="data" :height="160" :width="200"></item-image>
      </view>
    </view>
    <view v-if="type != 1">
      <view v-if="item.deal_with!=1" class="item-bt" @click="feedDetail">
        <view>
          查看详情
        </view>
    </view>

    </view>
  </view>
</template>

<script>
export default {
name: "feed-item",
  props:{
    item: {
      type: Object,
      default: {}
    },
    index: {
      type: Number,
      default: 0
    },
    type: {
      type: Number,
      default: 0
    },
  },
  methods:{
    feedDetail(){
      this.$u.route({
        url: '/pages/feedBack/feedDetail',
        params:{
          item:JSON.stringify(this.item)
        }
      });
    },
  }
}
</script>

<style scoped lang="scss">
.item{
  background: white;
  min-height: 600rpx;
  margin-bottom: 30rpx;
  padding: 32rpx;
  box-sizing: border-box;
  .item-top{
    padding-bottom: 32rpx;
    border-bottom: 2rpx solid $uni-border-color;
    .img{
      image{
        width: 60rpx;
        height: 60rpx;
        border: 2rpx solid #808080;
        border-radius: 50%;
        margin-right: 18rpx;
      }
      text{
        font-size: 28rpx;
        font-weight: bold;
        color:$uni-text-color ;
      }
    }
    .tag{
      padding: 6rpx 16rpx;
      margin-right: 10rpx;
      background: rgba(69, 128, 110, 0.26);
      border: 2rpx solid $uni-color-primary;
      color: $uni-color-primary;
      border-radius: 6rpx;
      margin-top: 20rpx;
      font-size: 24rpx;
    }
    .right{
      font-size: 28rpx;
      font-weight: 400;
      .adress{

        color: $uni-color-price;
      }
      .time{
        color: $uni-text-color-grey;
        margin-top: 8rpx;
        text-align: right;
      }
    }
  }
  .item-con{
    padding-top: 32rpx;
    font-size: 28rpx;
    font-weight: bold;
    margin-bottom: 20rpx;

  }
  .two{
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;  /* 超出n行这里写n */
    -webkit-box-orient: vertical;
  }
  .item-img{
    view{
      margin-right: 20rpx;
      margin-top: 20rpx;
      &:nth-child(3n+0){
        margin-right: 0;
      }
    }

  }
  .item-bt{

    display: flex;
    justify-content: flex-end;
    view{
      width: 160rpx;
      height: 60rpx;
      background: #F2F2F2;
      border: 2rpx solid #E3E3E3;
      border-radius: 12rpx;
      text-align: center;
      line-height: 60rpx;
      font-size: 28rpx;
      margin-top: 50rpx;
    }
  }

}
</style>